|
|
9.3 | Obtaining an IP address | ||
| 9.3.7 | Address Resolution Protocol (ARP) |
|
With TCP/IP networking, a data packet must
contain both a destination MAC address and a destination IP address.
If the packet is missing either one, the data will not pass from Layer
3 to the upper layers. In this way, MAC addresses and IP addresses act
as checks and balances for each other. After devices determine the IP
addresses of the destination devices, they can add the destination MAC
addresses to the data packets.
Some devices will keep tables that
contain MAC addresses and IP addresses of other devices that are
connected to the same LAN.
When a source determines the IP address for a destination, it then consults the ARP table in order to locate the MAC address for the destination. If the source locates an entry in its table, destination IP address to destination MAC address, it will associate the IP address to the MAC address and then uses it to encapsulate the data. The data packet is then sent out over the networking media to be picked up by the destination device. There are two ways that devices can
gather MAC addresses that they need to add to the encapsulated data.
The computer that requires an IP and MAC address pair broadcasts an ARP request. All the other devices on the local area network analyze this request. If one of the local devices matches the IP address of the request, it sends back an ARP reply that contains its IP-MAC pair. If the IP address is for the local area network and the computer does not exist or is turned off, there is no response to the ARP request. In this situation, the source device reports an error. If the request is for a different IP network, there is another process that can be used. Routers do not forward broadcast
packets. If the feature is turned on, a router performs a proxy ARP.
Another method to send data to the
address of a device that is on another network segment is to set up a
default gateway.
If the default gateway on the host or the proxy ARP feature on the router is not configured, no traffic can leave the local area network. One or the other is required to have a connection outside of the local area network.
|